package main

import (
	"net/http"
	"fmt"
)

func main() {
	resp, err := http.Get("https://www.163.com/")
	if err != nil {
		fmt.Println(err)
		return
	}

	defer resp.Body.Close()

	//状态
	fmt.Println(resp.Status)
	//状态码
	fmt.Println(resp.StatusCode)
	//头
	fmt.Println(resp.Header)

	buf := make([]byte, 4 * 1024)

	var tmp string
	for {
		n, err1 := resp.Body.Read(buf)
		if err1 != nil {
			fmt.Println(err1)
			break
		}
		tmp += string(buf[:n])
	}

	fmt.Println(tmp)
}
